import {mongo} from "#nuxt-mongodb"
import {ObjectId} from "mongodb"
interface userMes{
    id: string,
    phone:string,
}

export default defineEventHandler(async(event:any)=>{
    const {id,phone}:userMes = await readBody(event)

    const objectID =  new ObjectId(id)

    const result = await mongo.db().collection('user').findOne({account:phone});
    return {
        status: 200,
        data: result
    }
})